<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/1/4
 * Time: 14:58
 */

$data = file_get_contents("data.txt");
$line = explode("\r\n",$data);
$return = array();
foreach($line as $val)
{
    if(!empty($val)) {
        $field = explode("    ", $val);
        $return[] = array(
            "name" => $field[0],
            "email" => $field[1],
            "phone" => $field[2],
            "message" => $field[3],
            "time" => $field[4]
        );
    }
}
shuffle($return);
echo json_encode($return);














